package pages;

import org.openqa.selenium.By;
import sun.rmi.runtime.Log;
import utils.Log4Test;
import utils.WebDriverWrapper;


/**
 * Created by Vadim on 6/10/14.
 */
public class ComputersPage extends BasePage {
    private static final String URL_COMPUTERS = "http://rozetka.com.ua/computers-notebooks/c80253/";
    private static final By pageComputers = By.xpath(".//*[@id='computers-notebooks']/div/a[1]");

    public ComputersPage(WebDriverWrapper driver) {
        super(driver, URL_COMPUTERS);
    }

    @Override
    public void open() {
        driver.findElement(pageComputers).click();
        if (driver.getCurrentUrl().equals(URL_COMPUTERS)) {
            Log4Test.info("Page computers and notebooks is opened");
        } else {
            Log4Test.error("Page computers and notebooks isn't opened");
        }
    }

}
